rails db migration, undefined method `to_sym', cant figure out syntax
Posted
by oelbrenner
on Stack Overflow
See other posts from Stack Overflow
or by oelbrenner
Published on 2010-05-01T15:00:51Z
Indexed on
2010/05/01
15:07 UTC
Read the original article
Hit count: 208
ruby-on-rails
|migrations
the original migration looks like this:
class CreateUsers true do |t|
t.string :login, :limit => 40
t.string :name, :limit => 100, :default => '', :null => true
t.string :email, :limit => 100
t.string :crypted_password, :limit => 40
t.string :salt, :limit => 40
t.string :remember_token, :limit => 40
t.datetime :remember_token_expires_at
t.string :activation_code, :limit => 40
t.datetime :activated_at, :datetime
t.string :state, :null => :no, :default => 'passive'
t.datetime :deleted_at
t.integer :occupation_id, :null => :yes
t.datetime :paid_up_to_date, :date
t.timestamps
end
and I am trying to change the default of "state" to be "active" instead of passive so my attempt at a migration looks like this: ( still learning.. be gentle )
class ChangeUserStateDefault < ActiveRecord::Migration
def self.up
change_column :users, :state, :null => :no, :default => 'active'
end
def self.down
end
end
© Stack Overflow or respective owner